    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   1

          1                         ;^Z80^
          3                         ;NAME ^Rev 01 - DTT^
          4
          5                         De_DDP_MANAGER MACRO              ;Header Rev. 5
          6                                         .GOTO Ede_DDP_MANAGER
          7
          8                          Project:       H132, VS
          9
         10                          ******************************
         11                          *                            *
         12                          *  DDP_MANAGER           DTT   *
         13                          *                            *
         14                          ******************************
         15
         16                                Rev History
         17                                Rev.  Date         Name      Change
         18                                 1             DTT       DEVICE_ID --> DEV_ID
         19                                 0    9/9/83   DTT       Initial Pseudo Code
         20
         21                          Function:
         22
         23                               CONTROLS THE DIGITAL DATA PACK FOR READS AND WRITES SETUP BY TAPE_INTERFACE
         24
         25                         Ede_DDP_MANAGER  MEND
         26                         Pseudo_code_DDP_MANAGER    MACRO  ;Pseudocode macro area
         27                                            .GOTO Ep_DDP_MANAGER
         28
         29
         30
         31                         Ep_DDP_MANAGER  MEND
         32
         33
         34                         ;Inputs/Outputs passed in registers
         35                         ;  CALLED EVERY 60th SECOND BY THE NMI
         36
         37
         38           0008          TAPE1          EQU  08H
         39           0081          READ_TAPE      EQU  81H
         40           0082          WRITE_TAPE     EQU  82H
         41           0087          KILL_TAPE      EQU  87H
         42                          INCLUDE P_DCB_EQ.ASM                  ;INCLUDE P_DCB_EQU:EOS
         43                     A   ;THESE OUR EQUATES THAT ARE USED BY THE EOS PROGRAMS TO REFEFERNCE
         44                     A   ;PCB AND DCB INFORMATION
         45                     A
         46                     A
         47                     A   ;PCB EQUATES
         48                     A
         49           0000      A   P_COM_STAT             EQU     0       ; THIS IS THE COMMAND/STATUS BYTE
         50                     A
         51           0001      A   P_REL_ADDR             EQU     1       ; THIS IS THE RELOCATION ADDRESS
         52           0001      A   P_REL_ADDR_LO          EQU     P_REL_ADDR+0
         53           0002      A   P_REL_ADDR_HI          EQU     P_REL_ADDR+1
         54                     A
         55           0003      A   P_NUM_DCBS             EQU     3       ; THIS IS THE NUMBER OF DCBS DEFINED
         56                     A

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   2

         57                     A
         58           0004      A   P_SIZE                 EQU     4       ; THE NUMBER OF BYTES IN THE PCB
         59                     A
         60                     A
         61                     A
         62                     A   ;DCB EQUATES
         63                     A
         64           0000      A   D_COM_STAT            EQU     0       ; THE COMMAND STATUS BYTE
         65                     A
         66           0001      A   D_BUF_ADR             EQU     1       ; ADDRESS OF THE DATA BUFFER
         67           0001      A   D_BUF_ADR_LO          EQU     D_BUF_ADR+0
         68           0002      A   D_BUF_ADR_HI          EQU     D_BUF_ADR+1
         69                     A
         70           0003      A   D_BUF_LEN             EQU     3       ; THE LENGTH OF THE DATA BUFFER
         71           0003      A   D_BUF_LEN_LO          EQU     D_BUF_LEN+0
         72           0004      A   D_BUF_LEN_HI          EQU     D_BUF_LEN+1
         73                     A
         74           0005      A   D_SECT_NUM            EQU     5       ; THE BLOCK DEVICE SECTOR NUMBER
         75                     A
         76           0009      A   D_SEC_DEV_ID          EQU     9       ; SECONDARY DEVICE ID
         77                     A
         78           000E      A   D_RET_COUNT           EQU     14      ; THE NUMBER OF TIMES A COMMAND WILL
         79                     A                                          ; BE RETRIED.
         80           000E      A   D_RET_COUNT_LO        EQU     D_RET_COUNT+0
         81           000F      A   D_RET_COUNT_HI        EQU     D_RET_COUNT+1
         82                     A
         83           0010      A   D_DEV_ADDR            EQU     16      ; THE DEVICE ADDRESS (ID)
         84                     A
         85           0011      A   D_MAX_MSG_LEN         EQU     17      ; THE MAX LENGTH OF A DATA STRING
         86                     A                                          ; FOR THE DEVICE
         87           0011      A   D_MAX_MSG_LEN_LO      EQU     D_MAX_MSG_LEN+0
         88           0012      A   D_MAX_MSG_LEN_HI      EQU     D_MAX_MSG_LEN+1
         89                     A
         90           0013      A   D_DEV_TYPE            EQU     19      ; THE DEVICE TYPE, BLOCKED OR CHARACTGER
         91                     A
         92           0014      A   D_STATUS_FLAGS        EQU     20      ; DEVICE DEPENDENT STATUS FLAGS
         93                     A
         94                     A
         95                     A
         96           0015      A   D_SIZE                EQU     21      ; THE NUMBER OF BYTES IN THE DCB
         97                     A
         98                     A
         99                     A
        100                     A   ;DEVICE ID'S FOR THE KEYBOARD, PRINTER, AND TAPE DRIVE
        101                     A
        102           0001      A   KEYBOARD_ID            EQU     1       ; KYBD  ID
        103           0002      A   PRINTER_ID             EQU     2       ; PRINTER ID
        104           0008      A   TAPE_ID                EQU     8       ; TAPE DRIVE ID
        105                     A
        106           0002      A   ERROR_RETRY            EQU     2       ; MAX RETRYS ON ERRORS, READ_BLOCK AND WRITE_BLOCK
        107                     A
        108           000F      A   MAX_DEV_ADDR           EQU     15      ; HIGHEST POSSIBLE DEVICE ADDRESS
        109                     A                                          ;  ON NETWORK
        110                     A
        111                     A
        112                     A   ;PCB COMMAND EQUATES
        113                     A

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   3

        114           0000      A   PCB_IDLE               EQU     0       ; THIS IS AN IDLE STATE
        115                     A
        116           0001      A   PCB_SYNC1              EQU     1       ; SYNC BYTE 1
        117           0081      A   PCB_SYNC1_ACK          EQU     PCB_SYNC1+80H
        118                     A
        119           0002      A   PCB_SYNC2              EQU     2       ; SYNC BYTE 2
        120           0082      A   PCB_SYNC2_ACK          EQU     PCB_SYNC2+80H
        121                     A
        122           0003      A   PCB_SNA                EQU     3       ; SET NEW PCB ADDRESS
        123           0083      A   PCB_SNA_ACK            EQU     PCB_SNA+80H
        124                     A
        125           0004      A   PCB_RESET              EQU     4       ; RESET ALL NODES
        126           0084      A   PCB_RESET_ACK          EQU     PCB_RESET+80H
        127                     A
        128           0005      A   PCB_WAIT               EQU     5       ;
        129           0085      A   PCB_WAIT_ACK           EQU     PCB_WAIT+80H
        130                     A
        131                     A
        132                     A
        133                     A   ;DCB COMMAND EQUATES
        134                     A
        135           0000      A   DCB_IDLE               EQU     00      ;
        136           0001      A   DCB_STATUS             EQU     01      ; REQUEST STATUS
        137           0002      A   DCB_RESET              EQU     02      ; RESET NODE
        138           0003      A   DCB_WR                 EQU     03      ; WRITE DATA TO DEVICE
        139           0004      A   DCB_RD                 EQU     04      ; READ DATA FROM DEVICE
        140                     A
        141                     A
        142                     A
        143           FEC0      A   INIT_PCB_ADDR          EQU     0FEC0H  ; INITIAL ADDRESS OF THE PCB
        144                     A
        145                     A
        146                     A
        147                     A   ;GENERAL USAGE EQUATES FOR USE WITH DCB INFO
        148                     A
        149           0007      A   CMND_COMPLETE_BIT      EQU     7       ; THIS IS THE BIT THAT INDICATES THE
        150                     A                                          ; COMMAND HAS BEEN PROCESSED.
        151           0080      A   CMND_FIN_STATUS        EQU     80H     ; THIS IS THE STATUS OF A COMMAND
        152                     A                                          ; THAT COMPLETED WITH NO ERRORS
        153           008C      A   KBD_NAK                EQU     8CH     ; INDICATES NO KEY READY
        154                     A
        155           0086      A   PR_NAK                 EQU     86H     ; INDICATES THE PRINTER IS BUSY
        156                     A
        157           0003      A   ETX                    EQU     03H     ; END OF DATA STRING INDICATOR
        158                     A
        159           009B      A   TIMEOUT                EQU     9BH     ; DEVICE TIMED OUT
        160                          INCLUDE EOS_ERRS.ASM                  ;INCLUDE EOS_ERRS:EOS
        161                     A
        162           0001      A   DCB_NOT_FOUND          EQU     1       ; THERE WAS NO DCB FOR THE DEVICE REQUESTED.
        163           0002      A   DCB_BUSY               EQU     2       ; DCB IS BUSY
        164           0003      A   DCB_IDLE_ERR           EQU     3       ; DCB IS IDLE
        165                     A
        166           0004      A   NO_DATE_ERR            EQU     4
        167           0005      A   NO_FILE_ERR            EQU     5
        168           0006      A   FILE_EXISTS_ERR        EQU     6
        169           0007      A   NO_FCB_ERR             EQU     7
        170           0008      A   MATCH_ERR              EQU     8

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   4

        171           0009      A   BAD_FNUM_ERR           EQU     9
        172           000A      A   EOF_ERR                EQU     10
        173           000B      A   TOO_BIG_ERR            EQU     11
        174           000C      A   FULL_DIR_ERR           EQU     12
        175           000D      A   FULL_TAPE_ERR          EQU     13
        176           000E      A   FILE_NM_ERR            EQU     14               ;DLS(8/28/83)
        177           000F      A   RENAME_ERR             EQU     15               ;DLS(8/30/83)
        178           0010      A   DELETE_ERR             EQU     16               ;DLS(8/30/83)
        179           0011      A   RANGE_ERR              EQU     17               ;DLS(8/31/83)
        180                     A
        181           0012      A   CANT_SYNC1             EQU     18
        182           0013      A   CANT_SYNC2             EQU     19
        183           0014      A   PRT_ERR                EQU     20
        184                     A
        185           0015      A   RQ_TP_STAT_ERR         EQU     21
        186           0016      A   DEV_DEPD_ERR           EQU     22
        187
        188                         ;*EXTERNAL DATA AREAS USED:
        189
        190                                         EXT _START_RD_1_BLOCK
        191                                         EXT _FIND_DCB
        192                                         EXT _START_WR_1_BLOCK
        193                                         EXT _END_RD_1_BLOCK
        194
        195                         NEXT_STATE      MACRO LP1
        196                                  LD     A,LP1                          ;SOMETHING IN THE COMMAND BUFFER!
        197                                  LD     [D_TAPE_STATE],A
        198                                  LD     HL,[STATE_VECTORS+LP1+LP1]
        199                                  LD     [NEXT_STATE_ADDRESS],HL
        200                                  JP     END_OF_STATE_MACHINE
        201                                  MEND
        202
        203
        204
        205                                GLOBAL  DEV_ID
        206                                GLOBAL  INITIALIZE_DDP,INITIALIZE_TAPE,INIT_TAPE,INIT_DDP
        207   0000'                 INITIALIZE_DDP:
        208   0000'                 INITIALIZE_TAPE:
        209   0000'                 INIT_TAPE:
        210   0000'                 INIT_DDP:
        211   0000'                 INIT_CODE:
        212   0000' AF                       XOR    A
        213   0001' 32 0200"                 LD     (D_CSA),A
        214   0004' 32 0100"                 LD     (D_TAPE_STATE),A
        215   0007' 3D                       DEC    A
        216   0008' 32 0000"                 LD     (D_OVERLAY_NUMBER),A
        217   000B' 2A 1200'                 LD     HL,(STATE_VECTORS+0000)          ;IDLE STATE
        218   000E' 22 D200'                 LD     (NEXT_STATE_ADDRESS),HL
        219   0011' C9                       RET
        220   0012'                 STATE_VECTORS:
        221   0012' 1F00'                    DEFW   STATE_IDLE                       ;STATE 0
        222   0014' 2600'                    DEFW   STATE_1                          ;      1  REQUEST FOR I/O FOR 1 BLOCK
        223   0016' 5800'                    DEFW   STATE_2                          ;      2  TEST FOR COMPLETE AND REQUEST STATUS
        224   0018' 7B00'                    DEFW   STATE_3                          ;      3  TEST STATUS
        225           001A          LEN_INIT EQU $-INIT_CODE
        226                         ;*
        227                         ;*

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   5

        228
        229   001A'   0001                   DEFS   1BH-LEN_INIT    ;MAKE SURE THE MANAGER VECTOR IS AT THE SAME LOC AS THE S/IO_MANAGER
        230
        231
        232                                GLOBAL  DDP_MANAGER
        233                                GLOBAL  TAPE_MANAGER
        234   001B'                 TAPE_MANAGER:
        235   001B'                 DDP_MANAGER:
        236                         ;*  BEGIN        (Ordinarily registers are restored; retain only the pushes and pops you need.)
        237                         ;*
        238                         ;*
        239                         ;*
        240                         ;*                FALL THRU TO CASE STATEMENT     ;IF STATE = 6,7
        241                         ;*                                                ;FILE IS TRYING TO CLOSE
        242                         ;*
        243                         ;*
        244                         ;*        CASE    D_TAPE_STATE,(IDLE,STATE_1,STATE_2,STATE_3,INIT_DDP)
        245                         ;*
        246   001B'                 CASE_STATE:
        247                         ;*
        248                         ;*
        249   001B' 2A D200'                 LD     HL,[NEXT_STATE_ADDRESS]
        250   001E' E9                       JP     [HL]
        251                         ;*
        252                         ;*        IF THE MACHINE IS IDLE IT'S OK TO TEST FOR ANOTHER I/O REQUEST
        253                         ;*
        254   001F'                 STATE_IDLE:                                     ;STATE 0
        255   001F' 3A 0200"                 LD     A,[D_CSA]                 ;TEST THE COMMAND STATUS AREA
        256   0022' B7                       OR     A
        257   0023' F2 CF00'                 JP     P,END_OF_STATE_MACHINE    ;IF THE CSA CONTAINS AN ERROR CODE DON't PROCESS IT
        258                         ;*
        259                         ;*               FALL THROUGH TO STATE 1
        260                         ;*
        261   0026'                 STATE_1:
        262   0026' 3A 0200"        AB_REQ:  LD     A,(D_CSA)                          ;IF COMMAND IS TO KILL DDP COMMAND
        263   0029' FE 87                    CP     KILL_TAPE
        264   002B' CA 0000'                 JP     Z,INIT_DDP
        265                         ;*
        266                         ;*        REQUEST TO WRITE/READ A RECORD
        267                         ;*
        268
        269   002E' 2A 0300"                 LD     HL,(XFER_ADDR)
        270   0031' ED 5B 0500"              LD     DE,(BLOCK_NUM)
        271   0035' 01 0000                  LD     BC,0000H
        272   0038' 3A 0200"                 LD     A,(D_CSA)
        273   003B' FE 81                    CP     READ_TAPE
        274   003D' 3A D100'                 LD     A,(DEV_ID)
        275   0040' 20 05                    JR     NZ,EOS_TAPE_WRITE
        276   0042'                 EOS_TAPE_READ:
        277   0042' CD 0000#                 CALL   _START_RD_1_BLOCK
        278   0045' 18 03                    JR     RET_ADDR
        279   0047'                 EOS_TAPE_WRITE:
        280   0047' CD 0000#                 CALL   _START_WR_1_BLOCK
        281
        282
        283   004A'                 RET_ADDR:
        284   004A'                          NEXT_STATE 2

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   6

        285   004A' 3E 02       A            LD     A,2                          ;SOMETHING IN THE COMMAND BUFFER!
        286   004C' 32 0100"    A            LD     [D_TAPE_STATE],A
        287   004F' 2A 1600'    A            LD     HL,[STATE_VECTORS+2+2]
        288   0052' 22 D200'    A            LD     [NEXT_STATE_ADDRESS],HL
        289   0055' C3 CF00'    A            JP     END_OF_STATE_MACHINE
        290
        291                         ;*
        292                         ;*               TEST FOR ACCEPTANCE/COMPLETION OF I/O REQUEST
        293                         ;*
        294   0058'                 STATE_2:
        295   0058' 3A D100'                 LD     A,(DEV_ID)              ;TEST THE STATUS OF THE FILE
        296   005B' CD 0000#                 CALL   _END_RD_1_BLOCK
        297   005E' D2 CF00'                 JP     NC,END_OF_STATE_MACHINE           ;BETTER RETRY STATE 2
        298                         ;*
        299                         ;*        AT THIS POINT THE COMMAND HAS BEEN ACCEPTED BY THE NETWORK
        300                         ;*        IF THE ZERO FLAG IS NOT SET THERE HAVE BEEN ERRORS (09BH=TIMEOUT)
        301                         ;*
        302
        303   0061' 20 C3                    JR     NZ,STATE_1                         ;BETTER RETRY STATE 1
        304                         ;*
        305                         ;*        IF NO ERRORS THEN SET UP REQUEST STATUS OF THE TAPE DRIVE
        306                         ;*        THIS TESTS THE CHECK SUM (CRC) OF THE DATA XMITTED BY THE TAPE
        307                         ;*
        308   0063'                 STATE_2_OK:
        309                         ;*
        310   0063' 3A D100'                 LD   A,(DEV_ID)                          ;STATUS COMMAND
        311   0066' CD 0000#                 CALL _FIND_DCB
        312   0069' FD 36 00 01              LD   (IY+D_COM_STAT),DCB_STATUS
        313   006D'                          NEXT_STATE 3
        314   006D' 3E 03       A            LD     A,3                          ;SOMETHING IN THE COMMAND BUFFER!
        315   006F' 32 0100"    A            LD     [D_TAPE_STATE],A
        316   0072' 2A 1800'    A            LD     HL,[STATE_VECTORS+3+3]
        317   0075' 22 D200'    A            LD     [NEXT_STATE_ADDRESS],HL
        318   0078' C3 CF00'    A            JP     END_OF_STATE_MACHINE
        319                         ;*
        320                         ;*        IN STATE 3 TEST FOR ACCEPTANCE OF THE REQUEST FOR STATUS COMMAND
        321                         ;*
        322   007B'                 STATE_3:
        323   007B' 3A D100'                 LD   A,(DEV_ID)
        324   007E' CD 0000#                 CALL _FIND_DCB                            ;WAS THE STATUS REQUEST ACKNOWLEDGED????
        325   0081' FD CB 00 7E              BIT  CMND_COMPLETE_BIT,(IY+D_COM_STAT)
        326   0085' CA CF00'                 JP   Z,END_OF_STATE_MACHINE
        327                         ;*
        328                         ;*        IF THE COMMAND IS NOT YET ACCEPTED, COME BACK TO STATE 3 NEXT PASS
        329                         ;*
        330   0088' FD 7E 00                 LD   A,(IY+D_COM_STAT)                   ;STATUS COMMAND ACCEPTED
        331   008B' FE 80                    CP   080H
        332   008D' 20 D4                    JR   NZ,STATE_2_OK                        ;COULD NOT GET STATUS?
        333                         ;*
        334                         ;*
        335                         ;*
        336                                                                            ;SAVE THE STATUS IN REGISTER B
        337   008F' 3A D100'                 LD   A,(DEV_ID)                        ;CHECK FOR SECONDARY DEVICE ID
        338   0092' E6 F0                    AND  0F0H
        339   0094' FD 7E 14                 LD   A,(IY+D_STATUS_FLAGS)
        340   0097' 28 08                    JR   Z,DEV_0_CHECK                        ;SECONDARY_DEV_ID=0
        341   0099' CB 1F                    RR   A                                    ;GET STATUS INTO THE LOW NIBBLE

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   7

        342   009B' CB 1F                    RR   A
        343   009D' CB 1F                    RR   A
        344   009F' CB 1F                    RR   A
        345   00A1'                 DEV_0_CHECK:
        346   00A1' E6 0F                    AND  0FH
        347   00A3' C2 C600'                 JP   NZ,ERROR                             ;A BAD STATUS
        348                         ;*
        349                         ;*        IF THE COMMAND IS ACCEPTED AND THERE ARE NO ERRORS INCREMENT THE CSA DATA
        350                         ;*
        351   00A6' 2A 0300"                 LD   HL,(XFER_ADDR)                        ; A BLOCK HAS BEEN WRITTEN OR READ
        352   00A9' ED 5B 0500"              LD   DE,(BLOCK_NUM)                        ;UPDATE THE D_CSA AREA!
        353   00AD' 01 0004                  LD   BC,0400H
        354   00B0' 3A 0700"                 LD   A,(RANGE)
        355   00B3' 3D                       DEC  A
        356   00B4' CA 0000'                 JP   Z,INIT_DDP                           ;DONE WITH OVERLAY?
        357                         ;*
        358                         ;*        IF THE RANGE WAS DECREMENTED TO ZERO WE ARE DONE ELSE (WE ARE NOT?)
        359                         ;*
        360   00B7' 32 0700"                 LD   (RANGE),A
        361   00BA' 13                       INC  DE
        362   00BB' ED 53 0500"              LD   (BLOCK_NUM),DE
        363   00BF' 09                       ADD  HL,BC
        364   00C0' 22 0300"                 LD   (XFER_ADDR),HL
        365
        366   00C3' C3 2600'                 JP   STATE_1
        367
        368                         ;*
        369                         ;*               ERROR PROCESSING FROM REQUEST STATUS
        370                         ;*
        371   00C6'                 ERROR:
        372                         ;*               Errors occur after request status
        373                         ;*               Possible errors are 1=CRC error (bad data on tape)
        374                         ;*               2=block not found   3=no tape in drive  4=no drive
        375                         ;*               The user program is expected to test for errors via
        376                         ;*               TEST_TAPE in the TAPE_INTERFACE module.
        377                         ;*
        378                         ;*
        379   00C6' 32 0200"                  LD   (D_CSA),A                        ;SAVE THE ERROR CODE IN THE CSA
        380   00C9' 2A 1200'                  LD   HL,(STATE_VECTORS+0)             ;NEXT STATE = IDLE
        381   00CC' 22 D200'                  LD   (NEXT_STATE_ADDRESS),HL
        382
        383
        384                         ;*  END (DDP_MANAGER)
        385
        386   00CF'                 END_OF_STATE_MACHINE:
        387   00CF' AF                     XOR A
        388   00D0' C9                     RET
        389                         ;************************************************************************
        390                         ;*****           DEV_ID IS DEFAULT 08 FOR TAPE DRIVE 0           *****
        391                         ;************************************************************************
        392
        393
        394   00D1' 08              DEV_ID      DEFB TAPE1
        395
        396
        397                         ;************************************************************************
        398                         ;************************************************************************

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   8

        399                         ;************************************************************************
        400                                GLOBAL D_OVERLAY_NUMBER
        401                                GLOBAL D_TAPE_STATE
        402                                GLOBAL D_CSA
        403                         ;*--------------------------------------------------------------
        404                         ;*THE NEXT_STATE_ADDRESS MAY BE PUT IN DATA,PROG,OR COMN (IT'S ALL RAM TO ADAM)
        405                         ;*
        406   00D2'   0002          NEXT_STATE_ADDRESS DEFS 2
        407   00D4'                 ;*--------------------------------------------------------------
        408                         ;*               BY MAKING THE CSA COMMON IT IS EASILY LINKED
        409                         ;*               INTO EXISTING CODE
        410                          DATA
        411   0000"   0001          D_OVERLAY_NUMBER DEFS 1
        412   0001"   0001          D_TAPE_STATE     DEFS 1
        413   0002"   0006          D_CSA            DEFS 6
        414           0003"         XFER_ADDR EQU D_CSA+1
        415           0005"         BLOCK_NUM EQU XFER_ADDR+2
        416           0007"         RANGE     EQU BLOCK_NUM+2

         0 Error(s) Detected.   212 Program Bytes.     8 Data Bytes.
       113 Symbols Detected.

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page   9

    Value   Symbol          Defined         Referenced:

    0026' AB_REQ               262
    0009  BAD_FNUM_ERR         171
    0005" BLOCK_NUM            415     270   352   362   416
    0012  CANT_SYNC1           181
    0013  CANT_SYNC2           182
    001B' CASE_STATE           246
    0007  CMND_COMPLETE_BIT    149     325
    0080  CMND_FIN_STATUS      151
    0002  DCB_BUSY             163
    0000  DCB_IDLE             135
    0003  DCB_IDLE_ERR         164
    0001  DCB_NOT_FOUND        162
    0004  DCB_RD               139
    0002  DCB_RESET            137
    0001  DCB_STATUS           136     312
    0003  DCB_WR               138
    001B' DDP_MANAGER          235     232
    0010  DELETE_ERR           178
    00A1' DEV_0_CHECK          345     340
    0016  DEV_DEPD_ERR         186
    00D1' DEV_ID               394     205   274   295   310   323   337
    0001  D_BUF_ADR             66      67    68
    0002  D_BUF_ADR_HI          68
    0001  D_BUF_ADR_LO          67
    0003  D_BUF_LEN             70      71    72
    0004  D_BUF_LEN_HI          72
    0003  D_BUF_LEN_LO          71
    0000  D_COM_STAT            64     312   325   330
    0002" D_CSA                413     213   255   262   272   379   402   414
    0010  D_DEV_ADDR            83
    0013  D_DEV_TYPE            90
    0011  D_MAX_MSG_LEN         85      87    88
    0012  D_MAX_MSG_LEN_HI      88
    0011  D_MAX_MSG_LEN_LO      87
    0000" D_OVERLAY_NUMBER     411     216   400
    000E  D_RET_COUNT           78      80    81
    000F  D_RET_COUNT_HI        81
    000E  D_RET_COUNT_LO        80
    0005  D_SECT_NUM            74
    0009  D_SEC_DEV_ID          76
    0015  D_SIZE                96
    0014  D_STATUS_FLAGS        92     339
    0001" D_TAPE_STATE         412     214   286   315   401
    00CF' END_OF_STATE_MACHINE
                               386     257   289   297   318   326
    000A  EOF_ERR              172
    0042' EOS_TAPE_READ        276
    0047' EOS_TAPE_WRITE       279     275
    00C6' ERROR                371     347
    0002  ERROR_RETRY          106
    0003  ETX                  157
    0006  FILE_EXISTS_ERR      168
    000E  FILE_NM_ERR          176
    000C  FULL_DIR_ERR         174
    000D  FULL_TAPE_ERR        175
    0000' INITIALIZE_DDP       207     206
    0000' INITIALIZE_TAPE      208     206

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page  10

    Value   Symbol          Defined         Referenced:

    0000' INIT_CODE            211     225
    0000' INIT_DDP             210     206   264   356
    FEC0  INIT_PCB_ADDR        143
    0000' INIT_TAPE            209     206
    008C  KBD_NAK              153
    0001  KEYBOARD_ID          102
    0087  KILL_TAPE             41     263
    001A  LEN_INIT             225     229
    0008  MATCH_ERR            170
    000F  MAX_DEV_ADDR         108
    00D2' NEXT_STATE_ADDRESS
                               406     218   249   288   317   381
    0004  NO_DATE_ERR          166
    0007  NO_FCB_ERR           169
    0005  NO_FILE_ERR          167
    0000  PCB_IDLE             114
    0004  PCB_RESET            125     126
    0084  PCB_RESET_ACK        126
    0003  PCB_SNA              122     123
    0083  PCB_SNA_ACK          123
    0001  PCB_SYNC1            116     117
    0081  PCB_SYNC1_ACK        117
    0002  PCB_SYNC2            119     120
    0082  PCB_SYNC2_ACK        120
    0005  PCB_WAIT             128     129
    0085  PCB_WAIT_ACK         129
    0002  PRINTER_ID           103
    0014  PRT_ERR              183
    0086  PR_NAK               155
    0000  P_COM_STAT            49
    0003  P_NUM_DCBS            55
    0001  P_REL_ADDR            51      52    53
    0002  P_REL_ADDR_HI         53
    0001  P_REL_ADDR_LO         52
    0004  P_SIZE                58
    0007" RANGE                416     354   360
    0011  RANGE_ERR            179
    0081  READ_TAPE             39     273
    000F  RENAME_ERR           177
    004A' RET_ADDR             283     278
    0015  RQ_TP_STAT_ERR       185
    0026' STATE_1              261     222   303   366
    0058' STATE_2              294     223
    0063' STATE_2_OK           308     332
    007B' STATE_3              322     224
    001F' STATE_IDLE           254     221
    0012' STATE_VECTORS        220     217   287   316   380
    0008  TAPE1                 38     394
    0008  TAPE_ID              104
    001B' TAPE_MANAGER         234     233
    009B  TIMEOUT              159
    000B  TOO_BIG_ERR          173
    0082  WRITE_TAPE            40
    0003" XFER_ADDR            414     269   351   364   415
    0000# _END_RD_1_BLOCK              193   296
    0000# _FIND_DCB                    191   311   324
    0000# _START_RD_1_BLOCK            190   277

    FILE: DDP_MANAG:TOS      HEWLETT-PACKARD: DDP_MANAGER  (c) Coleco 1983 Confidential            Tue, 15 May 1984, 20:29     Page  11

    Value   Symbol          Defined         Referenced:

    0000# _START_WR_1_BLOCK            192   280